[misc] Add cloud api spec to public open api with rest client#5222
[misc] Add cloud api spec to public open api with rest client#5222
Conversation
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
…M APIs Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
📝 WalkthroughWalkthroughAdds multiple new REST client modules (Billing, EDR, EventStreaming, MSP, SCIM, IdentityProviders, Ingress, Instance, Peers extensions, Users invites, Networks router list, Events options) plus many generated API types and comprehensive integration tests; also extends Client struct to expose new API fields. Changes
Sequence Diagram(Skipped — changes are many separate client additions and tests; no single multi-component new control flow requires a sequence diagram.) Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@shared/management/client/rest/scim.go`:
- Around line 80-90: The Delete method (SCIMAPI.Delete) currently treats any
HTTP response as success because NewRequest returns a response without status
validation; update SCIMAPI.Delete to validate resp.StatusCode (accept 2xx only),
and if it's not a success code read and include the response body (or at least
the status and body snippet) in an error, ensure resp.Body is closed after
reading; alternatively factor this logic into NewRequest or a shared helper
(e.g., validateResponse(resp)) and apply it across other Delete methods (users,
tokens, setupkeys, routes, policies, peers, groups, events, dns, edr, networks,
dns_zones, accounts) so non-2xx responses return an error instead of nil.
In `@shared/management/http/api/types.gen.go`:
- Around line 2688-2692: The struct field comment for TenantResponse.Domain
incorrectly describes it as a "Price ID for checkout"; update the Go doc comment
above the Domain field (TenantResponse.Domain) to accurately describe it as the
tenant domain (e.g., "Domain The tenant's domain." or similar), then re-run the
OpenAPI/SDK generation pipeline to regenerate the spec and SDK docs so the
corrected description is propagated.
🧹 Nitpick comments (1)
shared/management/client/rest/msp.go (1)
66-75: Prefer the generated request-body type for UnlinkTenant.Using the typed request body keeps schema alignment and avoids unstructured maps.
♻️ Suggested change
- params := map[string]string{"owner": owner} - requestBytes, err := json.Marshal(params) + payload := api.PostApiIntegrationsMspTenantsIdUnlinkJSONRequestBody{ + Owner: owner, + } + requestBytes, err := json.Marshal(payload)
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@shared/management/http/api/types.gen.go`:
- Around line 590-603: The generated CreateIntegrationRequest currently has
required, non-pointer fields which prevents partial updates; change the OpenAPI
spec so the PUT/UpdateIntegration operation uses a distinct
UpdateIntegrationJSONRequestBody schema (do not alias it to
CreateIntegrationRequest) with platform, config, and enabled marked as optional,
then regenerate types so UpdateIntegrationJSONRequestBody becomes a struct with
pointer fields (e.g., *CreateIntegrationRequestPlatform, *map[string]string,
*bool) and json tags using `omitempty`; update any code references to use the
new UpdateIntegrationJSONRequestBody type for the PUT handler.
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
|



Describe your changes
Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Summary by CodeRabbit